// ==UserScript==
// @name         优化网页www.appsapk.com
// @namespace    https://viayoo.com/
// @version      0.1
// @description  显示www.appsapk.com网页中默认隐藏的侧边搜索框
// @author       buyi
// @run-at       document-start
// @match        https://*/*
// @grant        none
// ==/UserScript==
/*
 * @name: 优化网页www.appsapk.com
 * @Author: buyi
 * @version: 0.1
 * @description: 显示www.appsapk.com网页中默认隐藏的侧边搜索框
 * @include: *
 * @createTime: 2023-11-20 11:39:25
 * @updateTime: 2023-11-20 11:39:33
 */
(function () {
    'use strict';

    /* 遇到这些网站才执行 */
    var whiteList = ['www.appsapk.com'];

    if (whiteList.indexOf(window.location.hostname) < 0) {
        return;
    }

    /* 作者 */
    var author = 'buyi';
    /* 插件名 */
    var pluginName = 'www.appsapk.com';
    /* 生成绑定到 window 的属性名 */
    function getGlobalKey(keyName) {
        return encodeURIComponent(`${author}:${pluginName}:${keyName}`);
    }

    var pluginKeyName = getGlobalKey('plugin');
    /* 额外绑定到window的属性名：执行记录。实现：代码只执行一次 */
    var runTimesKeyName = getGlobalKey('执行记录');

    if (window[runTimesKeyName]) {
        return;
    }

    window[runTimesKeyName] = true;

    /* 这里写你的代码 */

    /* 显示隐藏的侧边搜索框 */
    var style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = `
    .sidr-class-search-header-wrap{
        display: block!important;
    }
    `;
    document.body.append(style);

    // var sideSearchHeaders = document.getElementsByClassName('sidr-class-search-header-wrap');
    // if (sideSearchHeaders[0]) {
    //     var target = sideSearchHeaders[0];
    //     target.className = '';
    // }
})();
